<?php

/**
 *   OPENSHOP VIP 卡片管理
 * 
 *   @link        http://baison.com.cn
 *   @copyright   Baison, Inc.
 *   @package     OpenShop
 *   @version     $Id: vipset.php,v 1.0 2009/08/29 08:36:58 $
 *   @author      Jiajun <jiajun@baison.com.cn>
 */

define('IN_OS', true);

require(dirname(__FILE__) . '/includes/init.php');

if(!isset($_REQUEST['act']) || empty($_REQUEST['act'])){
	$_REQUEST['act'] = 'vip_set';
}

if ($_REQUEST['act'] == 'vip_set')
{
	$smarty->assign('page_title',   'VIP卡查询');    // 页面标题
	$smarty->assign('flag',   0);
	$smarty->display('vip_set.dwt');
}

elseif ($_REQUEST['act'] == 'search')
{
	$card_sn = $_POST['card_sn'];
	$card_info = '';
	
	if($card_sn != ''){
		$sql = 'select * from '.$os->table('vipset').' as v where v.DM = "'.$card_sn.'"';
		$card_info = $db->getAll($sql);
	}
	
	$count = sizeof($card_info) == 1?1:0;
	
	$smarty->assign('flag',   1);    
	$smarty->assign('count',   $count);
	$smarty->assign('card_info',   $card_info[0]);	
	
	$smarty->display('vip_set.dwt');
}

?>